/**
 * 
 */
package FactoryMethod;

/**
 * @author sz
 *
 * create time：2012-9-25
 */
public class TestMain {
	
	public static void main(String[] args) {
		
		IFactory factory = new UndergraduateFactory();
		LeiFeng student = factory.CreateLeifeng();
		
		student.buyRice();
		student.sweep();
		student.wash();
		
		factory = new VolunteerFactory();
		LeiFeng volunteer = factory.CreateLeifeng();
		
		volunteer.buyRice();
		volunteer.sweep();
		volunteer.wash();
	}
	
}
